package com.zhou.util;

import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

/**
 * @author lang.zhou
 * @date 2022/4/29 17:20
 */
public class Md5Util {
    public static String hex(String text,String salt){
        Digester md5 = new Digester(DigestAlgorithm.MD5);
        md5.setSalt(salt.getBytes());
        return md5.digestHex(text);
    }
    public static String hex(byte[] data){
        Digester md5 = new Digester(DigestAlgorithm.MD5);
        return md5.digestHex(data);
    }
}
